package home.db;

import home.beans.Note;

import java.util.List;

/**
 * Created by Administrator on 2015/12/9.
 */
public class NoteDAO extends BaseDAO {
    public static List<Note> getNotes() throws Exception {
        List<Note> r = getClient().queryForList("getNotes", null);
        return r;
    }

    public static void saveNotes(String title, String content) throws Exception {
        Note n = new Note();
        n.setTitle(title);
        n.setContent(content);
        getClient().insert("saveNote", n);
    }

    public static void delNote(String id) throws Exception {
        getClient().delete("delNote", id);
    }
}
